<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: sc2::UnitTypeData Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sc2</b></li><li class="navelem"><a class="el" href="structsc2_1_1_unit_type_data.html">UnitTypeData</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structsc2_1_1_unit_type_data-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sc2::UnitTypeData Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Data about a unit type. This data is derived from the catalog (xml) data of the game and upgrades.  
 <a href="structsc2_1_1_unit_type_data.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="sc2__data_8h_source.html">sc2_data.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a69b29058353cf665ed27c32c1976f98b"><td class="memItemLeft" align="right" valign="top"><a id="a69b29058353cf665ed27c32c1976f98b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a69b29058353cf665ed27c32c1976f98b">UnitTypeData</a> ()</td></tr>
<tr class="memdesc:a69b29058353cf665ed27c32c1976f98b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a69b29058353cf665ed27c32c1976f98b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d05b07420d5c202b9f397968428254d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a4d05b07420d5c202b9f397968428254d">ReadFromProto</a> (const SC2APIProtocol::UnitTypeData &amp;unit_data)</td></tr>
<tr class="separator:a4d05b07420d5c202b9f397968428254d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a815413cf7f47aa41f20c3399b7d6f58c"><td class="memItemLeft" align="right" valign="top"><a id="a815413cf7f47aa41f20c3399b7d6f58c"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a815413cf7f47aa41f20c3399b7d6f58c">Log</a> () const</td></tr>
<tr class="memdesc:a815413cf7f47aa41f20c3399b7d6f58c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize this unit type to a string. <br /></td></tr>
<tr class="separator:a815413cf7f47aa41f20c3399b7d6f58c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a43563832b7287316ce6d1ff909dda831"><td class="memItemLeft" align="right" valign="top"><a id="a43563832b7287316ce6d1ff909dda831"></a>
<a class="el" href="classsc2_1_1_s_c2_type.html">UnitTypeID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a43563832b7287316ce6d1ff909dda831">unit_type_id</a></td></tr>
<tr class="memdesc:a43563832b7287316ce6d1ff909dda831"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stable ID. This ID will not change between patches. <br /></td></tr>
<tr class="separator:a43563832b7287316ce6d1ff909dda831"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefb802f470411fdba19e6b4ecb503427"><td class="memItemLeft" align="right" valign="top"><a id="aefb802f470411fdba19e6b4ecb503427"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#aefb802f470411fdba19e6b4ecb503427">name</a></td></tr>
<tr class="memdesc:aefb802f470411fdba19e6b4ecb503427"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsc2_1_1_unit.html" title="A unit. Could be a structure, a worker or a military unit. ">Unit</a> type name, corresponds to the game's catalog. <br /></td></tr>
<tr class="separator:aefb802f470411fdba19e6b4ecb503427"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9269cf7ef9d4907c467b5367e5a6f210"><td class="memItemLeft" align="right" valign="top"><a id="a9269cf7ef9d4907c467b5367e5a6f210"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a9269cf7ef9d4907c467b5367e5a6f210">available</a></td></tr>
<tr class="memdesc:a9269cf7ef9d4907c467b5367e5a6f210"><td class="mdescLeft">&#160;</td><td class="mdescRight">If true, the unit is available to the current mods/map. <br /></td></tr>
<tr class="separator:a9269cf7ef9d4907c467b5367e5a6f210"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13ab317cd91246aa40c928f48b801b38"><td class="memItemLeft" align="right" valign="top"><a id="a13ab317cd91246aa40c928f48b801b38"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a13ab317cd91246aa40c928f48b801b38">cargo_size</a></td></tr>
<tr class="memdesc:a13ab317cd91246aa40c928f48b801b38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of cargo slots they occupy in a transport. <br /></td></tr>
<tr class="separator:a13ab317cd91246aa40c928f48b801b38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50b767a68415cb1acbf246ee7f52ddcb"><td class="memItemLeft" align="right" valign="top"><a id="a50b767a68415cb1acbf246ee7f52ddcb"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a50b767a68415cb1acbf246ee7f52ddcb">mineral_cost</a></td></tr>
<tr class="memdesc:a50b767a68415cb1acbf246ee7f52ddcb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cost in minerals to build this unit type. <br /></td></tr>
<tr class="separator:a50b767a68415cb1acbf246ee7f52ddcb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af596e50795f2b903b633cc7a72d43ae5"><td class="memItemLeft" align="right" valign="top"><a id="af596e50795f2b903b633cc7a72d43ae5"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#af596e50795f2b903b633cc7a72d43ae5">vespene_cost</a></td></tr>
<tr class="memdesc:af596e50795f2b903b633cc7a72d43ae5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cost in vespene to build this unit type. <br /></td></tr>
<tr class="separator:af596e50795f2b903b633cc7a72d43ae5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a07aba0d860ed9439104895ef2fc1f9"><td class="memItemLeft" align="right" valign="top"><a id="a1a07aba0d860ed9439104895ef2fc1f9"></a>
std::vector&lt; Attribute &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#a1a07aba0d860ed9439104895ef2fc1f9">attributes</a></td></tr>
<tr class="memdesc:a1a07aba0d860ed9439104895ef2fc1f9"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsc2_1_1_unit.html" title="A unit. Could be a structure, a worker or a military unit. ">Unit</a> attributes, may change based on upgrades. <br /></td></tr>
<tr class="separator:a1a07aba0d860ed9439104895ef2fc1f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac26ad858a8101e13d323c4111df9700b"><td class="memItemLeft" align="right" valign="top"><a id="ac26ad858a8101e13d323c4111df9700b"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#ac26ad858a8101e13d323c4111df9700b">movement_speed</a></td></tr>
<tr class="memdesc:ac26ad858a8101e13d323c4111df9700b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Movement speed of unit type. <br /></td></tr>
<tr class="separator:ac26ad858a8101e13d323c4111df9700b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afadeb2efc945bac24492cd4efd0dba28"><td class="memItemLeft" align="right" valign="top"><a id="afadeb2efc945bac24492cd4efd0dba28"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#afadeb2efc945bac24492cd4efd0dba28">armor</a></td></tr>
<tr class="memdesc:afadeb2efc945bac24492cd4efd0dba28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Armor of unit type. <br /></td></tr>
<tr class="separator:afadeb2efc945bac24492cd4efd0dba28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad375db4df763eafc47589a1b20c8553"><td class="memItemLeft" align="right" valign="top"><a id="aad375db4df763eafc47589a1b20c8553"></a>
std::vector&lt; <a class="el" href="structsc2_1_1_weapon.html">Weapon</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_type_data.html#aad375db4df763eafc47589a1b20c8553">weapons</a></td></tr>
<tr class="memdesc:aad375db4df763eafc47589a1b20c8553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Weapons on this unit type. <br /></td></tr>
<tr class="separator:aad375db4df763eafc47589a1b20c8553"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Data about a unit type. This data is derived from the catalog (xml) data of the game and upgrades. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a4d05b07420d5c202b9f397968428254d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d05b07420d5c202b9f397968428254d">&#9670;&nbsp;</a></span>ReadFromProto()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sc2::UnitTypeData::ReadFromProto </td>
          <td>(</td>
          <td class="paramtype">const SC2APIProtocol::UnitTypeData &amp;&#160;</td>
          <td class="paramname"><em>unit_data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize this ability entry from the .proto file (used internally). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_data</td><td>The proto entry for this ability. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/sc2api/<a class="el" href="sc2__data_8h_source.html">sc2_data.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
